<?php
/**
 * 将ID自由排列
 * @author wangtao
 * @version 2011.06.22
 */

set_time_limit(0);
define('IN_WT', true);
include 'include.php';
include 'config.php';
$i = 88385;
for ( ; $i < 90000 ; $i++ )
{
	$sql = 'SELECT `Pid` FROM `post_into` WHERE `Pid` =' . $i . ' LIMIT 0 , 1';
	$db = mysqlDB::con();
	$pid = $db->query2one($sql);
	if ($pid)
	{
		$sql3 = 'SELECT COUNT( 0 ) AS `c` FROM `post_into`WHERE `Pid` <' . $pid;
		$newPid = $db->query2one($sql3);
		$newPid += 1;
		$sql2 = 'UPDATE `feed`.`post_into` SET `Pid` = \'' . $newPid . '\' WHERE `post_into`.`Pid` =' . $pid . ' LIMIT 1;';
		#die($sql2);
		$db->query($sql2);
		#die($pid);
	}
}


